<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        for(var i = 0; i < 10; i++){
            document.write('a');
        }

        var j = 0;
        for(;j < 10;){  // 如果有的地方没写，就直接略过,其实相当于while循环
            document.write('b');
            j++;
        }

        /*可以很灵活*/
        var i = 1;
        var count = 0;
        for(; i;){   // 相当于while(i)
            document.write('c');
            count ++;
            if(count == 10) {
                i = 0;
            }
        }
    </script>

    <script>
        var num = 0;
        while(num < 10) {
            document.write(num);
            num ++;
        }
       // while(1) 死循环



       //do - while 循环
       var numb = 0;
       do {
          document.write('a');
          numb ++;
       }while(numb < 10)


    </script>
</body>
</html>